Son Nguyen
September 9, 2019
Content- Based Filtering: Recommeding to user A based on his/her existing profiles.
Collaborative Filtering: Recommeding to user A based on his/her community's profiles.
Assume there are four categories of news A) Politics B) Sports C) Entertainment D) Technology
User A who has read 10 articles related to Technology
Recommend a new article in Technology for him to read.
Assume there are four categories of news A) Politics B) Sports C) Entertainment D) Technology
User A who has read 10 articles related to Technology
User B who has read the same 10 articles related to Technology and an X article in Sports.
Recommend the article X to user A.
| Item 1 | Item 2 | Item 3 | Item 4 | Item 5 | |
|---|---|---|---|---|---|
| Alice | 5 | 3 | 4 | 4 | ??? |
| User 1 | 3 | 1 | 2 | 3 | 3 |
| User 2 | 4 | 3 | 4 | 3 | 5 |
| User 3 | 3 | 3 | 1 | 4 | 4 |
| User 4 | 1 | 5 | 5 | 2 | 1 |
A recommendation problem tunrs into a prediction problem.
Predict the rating of the new user on his/her new item.
If the predicted rating of Alice on Item 5 are high (4 or 5), we will recommend Item 5 to her.
| Item 1 | Item 2 | Item 3 | Item 4 | Item 5 | |
|---|---|---|---|---|---|
| Alice | 5 | 3 | 4 | 4 | ??? |
| User 1 | 3 | 1 | 2 | 3 | 3 |
| User 2 | 4 | 3 | 4 | 3 | 5 |
| User 3 | 3 | 3 | 1 | 4 | 4 |
| User 4 | 1 | 5 | 5 | 2 | 1 |
| Item 1 | Item 2 | Item 3 | Item 4 | Item 5 | |
|---|---|---|---|---|---|
| Alice | 5 | 3 | 4 | 4 | ??? |
| User 1 | 3 | 1 | 2 | 3 | 3 |
| User 2 | 4 | 3 | 4 | 3 | 5 |
| User 3 | 3 | 3 | 1 | 4 | 4 |
| User 4 | 1 | 5 | 5 | 2 | 1 |
Let \( A1 \) is the distance from Alice to User 1 and so on. We have:
\[ A1 = 3.60 \\ A2 = 1.41 \\ A3 = 3.60 \\ A4 = 5 \]
For 3NN, the predicted rating of Alice for item 5 is the average of ratings on item 5 of her 3 neast neighbors, User 1, 2 and 3.
Predicted rating of Alicie on item 5 is: (3+5+4)/3 = 4.
We will recommend item 5 to Alice.
| Item 1 | Item 2 | Item 3 | Item 4 | Item 5 | |
|---|---|---|---|---|---|
| Alice | 5 | 3 | 4 | 4 | ??? |
| User 1 | 3 | 1 | 2 | 3 | 3 |
| User 2 | 4 | 3 | 4 | 3 | 5 |
| User 3 | 3 | 3 | 1 | 4 | 4 |
| User 4 | 1 | 5 | 5 | 2 | 1 |
| Item 1 | Item 2 | Item 3 | Item 4 | Item 5 | |
|---|---|---|---|---|---|
| Alice | 5 | 3 | 4 | 4 | ??? |
| User 1 | 3 | 1 | 2 | 3 | 3 |
| User 2 | 4 | 3 | 4 | 3 | 5 |
| User 3 | 3 | 3 | 1 | 4 | 4 |
| User 4 | 1 | 5 | 5 | 2 | 1 |
Let \( d54 \) be the distance of item 5 to item 4 and so on. We have
\[ d54 = 2.23\\ d53 = 5.19 \\ d52 = 5 \\ d51 = 1.41 \]
For 3NN, the two nearest neighbors of Item 5 are Item 1,4 and Item 2.
Predicted rating of Alice on Item 5 is the average of her ratings on Item 1, 4 and 2, which is (5+4+3)/3 = 4
We recommend her to buy Item 5!
| Item 1 | Item 2 | Item 3 | Item 4 | |
|---|---|---|---|---|
| Alice | 5 | 3 | 4 | 4 |
| User 1 | 3 | 1 | 2 | 3 |
| Item 1 | Item 2 | Item 3 | Item 4 | |
|---|---|---|---|---|
| Alice | 5 | 3 | 4 | 4 |
| User 1 | 3 | 1 | 2 | 3 |
\[ S1 = \frac{5 \cdot 3 + 3 \cdot 1 + 4 \cdot 2 + 4 \cdot 3}{\sqrt{5^2+3^2+4^2+4^2}\cdot \sqrt{3^2+1^2+2^2+3^2}} = 0.975 \]